﻿<%@ Page Language="C#"  AutoEventWireup="true" CodeFile="user_edit.aspx.cs" Inherits="admin_user_user_edit" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>编辑用户</title>
    <link href="../scripts/ui/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
    <link href="../images/style.css" rel="stylesheet" type="text/css" />
    <link href="../select/skins/style.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../scripts/jquery/jquery-1.3.2.min.js"></script>
    <script type="text/javascript" src="../scripts/jquery/jquery.validate.min.js"></script>
    <script type="text/javascript" src="../scripts/jquery/messages_cn.js"></script>
    <script type="text/javascript" src="../scripts/ui/js/ligerBuild.min.js"></script>
    <script type="text/javascript" src="../js/function.js"></script>
    <script type="text/javascript" src="../select/js/select_split.js"></script>
    <script type="text/javascript">
    //表单验证
        $(function () {
            $("#frmform").validate({
                errorElement: "span",
                success: "success",
                invalidHandler: function (e, validator) {
                    parent.jsprint("有 " + validator.numberOfInvalids() + " 项填写有误，请检查！", "", "Warning");
                },
                rules: {
                    ddlRoleId: "required",
                    ddlBranch: "required",
                    txtUserID: {
                        remote: {
                            type: "post",
                            url: "../tools/submit_ajax.ashx?action=validate_user_id",
                            data: {
                                user_id: function () {
                                    return $("#txtUserID").val();
                                }
                            },
                            dataType: "html",
                            dataFilter: function (data, type) {
                                if (data == "true")
                                    return true;
                                else
                                    return false;
                            }
                        }
                    }
                },
                messages: {
                    ddlRoleId: "请选择用户角色",
                    ddlBranch: "请选择用户部门",
                    txtUserID: { remote: "抱歉，该用户编号已存在" }
                }
            });
        });
        //表单重置
        function ChangeReset() {
            $("#frmform")[0].reset();
            $("#ddlRoleId").get(0).selectedIndex = 0;
            selRefresh("ddlRoleId");
            $("#ddlBranch ").get(0).selectedIndex = 0;
            selRefresh("ddlBranch");
        };  
    </script>
</head>
<body class="mainbody">
<form id="frmform" runat="server" method="post">
<div class="navigation"><a href="javascript:history.go(-1);" class="back">后退</a>首页 &gt; 系统信息管理 &gt; 用户管理</div>
<div id="contentTab">
    <ul class="tab_nav">
        <li class="selected"><a onclick="tabs('#contentTab',0);" href="javascript:;">编辑用户信息</a></li>
    </ul>
    <div class="tab_con" style="display:block;">
        <table class="form_table">
            <col width="180px" />
            <tbody>
            <tr>
                <th>用户角色：</th>
              <%--  <td><asp:DropDownList ID="ddlRoleId" runat="server" CssClass="select2 required"/></td>--%>
                <td><select id="ddlRoleId" runat="server" autowidth="true"></select></td>
            </tr>          
             <tr>
                <th>用户部门：</th>
               <%-- <td><asp:DropDownList ID="ddlBranch" runat="server" CssClass="select2 required"/></td>--%>
                <td><select id="ddlBranch" runat="server" autowidth="true"></select></td>
            </tr>
             <tr>
                <th>账户状态：</th>
                <td>
                    <asp:RadioButtonList ID="rblIsLock" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
                        <asp:ListItem Selected="True" Value="0">启用 </asp:ListItem>
                        <asp:ListItem Value="1">禁用 </asp:ListItem>
                    </asp:RadioButtonList><label>* 禁用的用户将无法登录</label>
                </td>
            </tr>
            <tr>
                <th>用户编号：</th>
                <td><asp:TextBox ID="txtUserID" runat="server" CssClass="txtInput normal required" minlength="2" maxlength="100"></asp:TextBox><label>* 登录的用户名</label></td>
            </tr>
            <tr>
                <th>登录密码：</th>
                <td><asp:TextBox ID="txtUserPwd" runat="server" CssClass="txtInput normal required" 
                        minlength="2" maxlength="16" TextMode="Password"></asp:TextBox><label>* 2-16位大小写字母、数字或特殊字符</label></td>
            </tr>
            <tr>
                <th>确认密码：</th>
                <td><asp:TextBox ID="txtUserPwd1" runat="server" CssClass="txtInput normal required" 
                        minlength="2" maxlength="16" TextMode="Password" equalTo="#txtUserPwd"></asp:TextBox><label>*</label></td>
            </tr>
            <tr>
                <th>姓名：</th>
                <td><asp:TextBox ID="txtUserName" runat="server" CssClass="txtInput normal required" minlength="2" maxlength="30"></asp:TextBox><label>*</label></td>
            </tr>
            <tr>
                <th>电话：</th>
                <td><asp:TextBox ID="txtTelephone" runat="server" CssClass="txtInput normal digits" minlength="2" maxlength="30"></asp:TextBox></td>
            </tr>
            <tr>
                <th>邮箱：</th>
                <td><asp:TextBox ID="txtEmail" runat="server" CssClass="txtInput normal email" minlength="2" maxlength="50"></asp:TextBox></td>
            </tr>
            <tr>
                <th></th>
                <td><asp:Button ID="btnSubmit" runat="server" Text="提交保存" CssClass="btnblue" onclick="btnSubmit_Click" onfocus="this.blur()"  /> &nbsp;&nbsp;&nbsp;
                    <input name="重置" type="button" class="btnblue" value="重置" onclick="ChangeReset()" /></td>    
            </tr>
            </tbody>
        </table>
    </div>   
</div>
</form>
</body>
</html>

